﻿using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI;
using ParamSettings;
using RevitMenuSetting;
using System;
using System.Reflection;

namespace RevitAddin
{
    [TransactionAttribute(TransactionMode.Manual)]
    [RegenerationAttribute(RegenerationOption.Manual)]
    public class Start : IExternalApplication
    {


        public Result OnStartup(UIControlledApplication application)
        {
            try
            {
                ParamManager.InitNewSettingFile("C:\\ProgramData\\Autodesk\\Revit\\Addins\\2020\\whdqh\\paramSet-path.txt", globalVar.pathParam);
                ParamManager.InitNewSettingFile("C:\\ProgramData\\Autodesk\\Revit\\Addins\\2020\\whdqh\\paramSet-ui.txt", globalVar.uiParam);
                RevitMenuSettingManager.Init(application, "C:\\ProgramData\\Autodesk\\Revit\\Addins\\2020\\whdqh\\menuSet.txt",Assembly.GetAssembly(this.GetType()).Location);
            }
            catch (Exception ex)
            {
            }
            return Result.Succeeded;
        }
        public Result OnShutdown(UIControlledApplication application)
        {
            return Result.Succeeded;
        }

    }
}
